package com.jhs.kjs.model.daumMap;

import java.util.Calendar;
import java.util.Date;

import com.jhs.kjs.model.daumMap.frame.ILatLng;
import com.jhs.kjs.model.daumMap.frame.ExtDirection;

public class CarInfo implements ILatLng{
	private Date date;
	private Double lat;
	private Double lng;
	private int direction;
	public CarInfo(String day, String time, Double lng, Double lat, String sAngle){
		int angle = Integer.parseInt(sAngle);
		Calendar cal = Calendar.getInstance();
		int yy, mm, dd, hh, min, sec;
		yy = Integer.parseInt(day.substring(0, 2));
		mm = Integer.parseInt(day.substring(2, 4));
		dd = Integer.parseInt(day.substring(4, 6));
		hh = Integer.parseInt(time.substring(0, 2));
		min = Integer.parseInt(time.substring(2, 4));
		sec = Integer.parseInt(time.substring(4, 6));

		cal.set(yy, mm, dd, hh, min, sec);
		
		setDate(cal.getTime());
		setLat(lat);
		setLng(lng);
		setDirection(angle);
	}
	

	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Double getLat() {
		return lat/1000000;
	}
	public void setLat(Double lat) {
		this.lat = lat;
	}
	public Double getLng() {
		return lng/1000000;
	}
	public void setLng(Double lng) {
		this.lng = lng;
	}

	@Override
	public int getCardinal() {
		return ExtDirection.getCardinal(getDirection());
	}

	@Override
	public int getDirection() {
		return direction;
	}

	@Override
	public void setDirection(int direction) {
		this.direction = direction;
	}


	@Override
	public Long getEpochtime() {
		// TODO Auto-generated method stub
		return null;
	}

}
